home *** CD-ROM | disk | FTP | other *** search
-
-
-
- RRRRWWWWGGGGSSSSlllliiiisssstttt((((3333CCCC++++++++)))) RRRRWWWWGGGGSSSSlllliiiisssstttt((((3333CCCC++++++++))))
-
-
-
- NNNNaaaammmmeeee
- RWGSlist(type) - Rogue Wave library class
-
- SSSSyyyynnnnooooppppssssiiiissss
- #include <rw/gslist.h>
-
-
-
- declare(RWGSlist, type)
- RWGSlist(type) a ;
-
-
-
-
- DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn
- Class RRRRWWWWGGGGSSSSlllliiiisssstttt((((ttttyyyyppppeeee)))) represents a group of ordered elements of type ttttyyyyppppeeee,
- not accessible by an external key. Duplicates are allowed. This class
- is implemented as a singly-linked list. Objects of type RRRRWWWWGGGGSSSSlllliiiisssstttt((((ttttyyyyppppeeee))))
- are declared with macros defined in the standard C++ header file
- <<<<ggggeeeennnneeeerrrriiiicccc....hhhh>>>>. In order to find a particular item within the collection, a
- user-provided global "tester" function is required to test for a "match,"
- definable in any consistent way. This function should have prototype:
-
- RWBoolean yyyyoooouuuurrrrTTTTeeeesssstttteeeerrrrFFFFuuuunnnnccccttttiiiioooonnnn(const ttttyyyyppppeeee* c, const void* d);
-
-
-
-
-
- The argument cccc is a candidate within the collection to be tested for a
- match. The argument dddd is for your convenience and will be passed to
- yyyyoooouuuurrrrTTTTeeeesssstttteeeerrrrFFFFuuuunnnnccccttttiiiioooonnnn(((()))). The function should return TTTTRRRRUUUUEEEE if a "match" is
- found between cccc and dddd. In order to simplify the documentation below, an
- imaginary typedef
-
- typedef RWBoolean (*yyyyoooouuuurrrrTTTTeeeesssstttteeeerrrr)(const ttttyyyyppppeeee*, const void*);
-
-
-
-
-
- has been used for this tester function.
-
- PPPPeeeerrrrssssiiiisssstttteeeennnncccceeee
- None
-
- PPPPuuuubbbblllliiiicccc CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrrssss
- RRRRWWWWGGGGSSSSlllliiiisssstttt(ttttyyyyppppeeee)();
-
-
- Construct an empty collection.
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- RRRRWWWWGGGGSSSSlllliiiisssstttt((((3333CCCC++++++++)))) RRRRWWWWGGGGSSSSlllliiiisssstttt((((3333CCCC++++++++))))
-
-
-
- RRRRWWWWGGGGSSSSlllliiiisssstttt(ttttyyyyppppeeee)(ttttyyyyppppeeee* a);
-
-
- Construct a collection with one entry aaaa.
-
- RRRRWWWWGGGGSSSSlllliiiisssstttt(ttttyyyyppppeeee)(const RWGSlist(ttttyyyyppppeeee)& a);
-
-
- Copy constructor. A shallow copy of aaaa is made.
-
- AAAAssssssssiiiiggggnnnnmmmmeeeennnntttt OOOOppppeeeerrrraaaattttoooorrrr
- void
- ooooppppeeeerrrraaaattttoooorrrr====(const RWGSlist(type)&);
-
-
- Assignment operator. A shallow copy of aaaa is made.
-
- PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrr FFFFuuuunnnnccccttttiiiioooonnnnssss
- ttttyyyyppppeeee*
- append(ttttyyyyppppeeee* a);
-
-
- Adds an item to the end of the collection and returns it. Returns nnnniiiillll if
- the insertion was unsuccessful.
-
- void
- aaaappppppppllllyyyy(void (*ap)(ttttyyyyppppeeee*, void*), void* );
-
-
- Visits all the items in the collection in order, from first to last,
- calling the user-provided function pointed to by aaaapppp for each item. This
- function should have prototype:
-
- void yyyyoooouuuurrrrAAAAppppppppllllyyyyFFFFuuuunnnnccccttttiiiioooonnnn(type* c, void*);
-
-
-
-
-
- and can perform any operation on the object at address cccc. The last
- argument is useful for passing data to the apply function.
-
- ttttyyyyppppeeee*&
- aaaatttt(size_t i);
- const ttttyyyyppppeeee*
- aaaatttt(size_t i) const;
-
-
- Returns a pointer to the iiiith item in the collection. The first variant
- can be used as an lvalue, the second cannot. The index iiii must be between
- zero and the number of items in the collection less one, or an exception
- of type TTTTOOOOOOOOLLLL____IIIINNNNDDDDEEEEXXXX will be thrown.
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- RRRRWWWWGGGGSSSSlllliiiisssstttt((((3333CCCC++++++++)))) RRRRWWWWGGGGSSSSlllliiiisssstttt((((3333CCCC++++++++))))
-
-
-
- void
- cccclllleeeeaaaarrrr();
-
-
- Removes all items in the collection.
-
- RWBoolean
- ccccoooonnnnttttaaaaiiiinnnnssss(yyyyoooouuuurrrrTTTTeeeesssstttteeeerrrr t, const void* d) const;
-
-
- Returns TTTTRRRRUUUUEEEE if the collection contains an item for which the user-
- defined function pointed to by tttt finds a match with dddd.
-
- RWBoolean
- ccccoooonnnnttttaaaaiiiinnnnssssRRRReeeeffffeeeerrrreeeennnncccceeee(const ttttyyyyppppeeee* e) const;
-
-
- Returns TTTTRRRRUUUUEEEE if the collection contains an item with the address eeee....
-
- size_t
- eeeennnnttttrrrriiiieeeessss() const;
-
-
- Returns the number of items in the collection.
-
- ttttyyyyppppeeee*
- ffffiiiinnnndddd(yyyyoooouuuurrrrTTTTeeeesssstttteeeerrrr t, const void* d) const;
-
-
- Returns the first item in the collection for which the user-provided
- function pointed to by tttt finds a match with dddd, or nnnniiiillll if no item is
- found.
-
- ttttyyyyppppeeee*
- ffffiiiinnnnddddRRRReeeeffffeeeerrrreeeennnncccceeee(const ttttyyyyppppeeee* e) const;
-
-
- Returns the first item in the collection with the address eeee, or nnnniiiillll if no
- item is found.
-
- ttttyyyyppppeeee*
- ffffiiiirrrrsssstttt() const;
-
-
- Returns the first item of the collection.
-
- ttttyyyyppppeeee*
- ggggeeeetttt();
-
-
- Returns and rrrreeeemmmmoooovvvveeeessss the first item of the collection.
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-
-
-
- RRRRWWWWGGGGSSSSlllliiiisssstttt((((3333CCCC++++++++)))) RRRRWWWWGGGGSSSSlllliiiisssstttt((((3333CCCC++++++++))))
-
-
-
- ttttyyyyppppeeee*
- iiiinnnnsssseeeerrrrtttt(ttttyyyyppppeeee* e);
-
-
- Adds an item to the end of the collection and returns it. Returns nnnniiiillll if
- the insertion was unsuccessful.
-
- void
- iiiinnnnsssseeeerrrrttttAAAAtttt(size_t indx, ttttyyyyppppeeee* e);
-
-
- Adds a new item to the collection at position iiiinnnnddddxxxx. The item previously
- at position iiii is moved to iiii++++1111, eeeettttcccc. The index iiiinnnnddddxxxx must be between 0 and
- the number of items in the collection, or an exception of type TTTTOOOOOOOOLLLL____IIIINNNNDDDDEEEEXXXX
- will be thrown.
-
- RWBoolean
- iiiissssEEEEmmmmppppttttyyyy() const;
-
-
- Returns TTTTRRRRUUUUEEEE if the collection is empty, otherwise FFFFAAAALLLLSSSSEEEE.
-
- ttttyyyyppppeeee*
- llllaaaasssstttt() const;
-
-
- Returns the last item of the collection.
-
- size_t
- ooooccccccccuuuurrrrrrrreeeennnncccceeeessssOOOOffff(yyyyoooouuuurrrrTTTTeeeesssstttteeeerrrr t, const void* d) const;
-
-
- Returns the number of occurrences in the collection for which the user-
- provided function pointed to by tttt finds a match with dddd.
-
- size_t
- ooooccccccccuuuurrrrrrrreeeennnncccceeeessssOOOOffffRRRReeeeffffeeeerrrreeeennnncccceeee(const ttttyyyyppppeeee* e) const;
-
-
- Returns the number of items in the collection with the address eeee....
-
- ttttyyyyppppeeee*
- pppprrrreeeeppppeeeennnndddd(const ttttyyyyppppeeee* a);
-
-
- Adds an item to the beginning of the collection and returns it. Returns
- nnnniiiillll if the insertion was unsuccessful.
-
- ttttyyyyppppeeee*
- rrrreeeemmmmoooovvvveeee(yyyyoooouuuurrrrTTTTeeeesssstttteeeerrrr t, const void* d);
-
-
-
-
-
- PPPPaaaaggggeeee 4444
-
-
-
-
-
-
- RRRRWWWWGGGGSSSSlllliiiisssstttt((((3333CCCC++++++++)))) RRRRWWWWGGGGSSSSlllliiiisssstttt((((3333CCCC++++++++))))
-
-
-
- Removes and returns the first item from the collection for which the
- user-provided function pointed to by tttt finds a match with dddd, or returns
- nnnniiiillll if no item is found.
-
- ttttyyyyppppeeee*
- rrrreeeemmmmoooovvvveeeeRRRReeeeffffeeeerrrreeeennnncccceeee(const ttttyyyyppppeeee* e);
-
-
- Removes and returns the first item from the collection with the address
- eeee, or returns nnnniiiillll if no item is found.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 5555
-
-
-
-